/**
 * 
 */
package com.zito.web.www;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.downlove.template.freemarker.FreeMarkerEngine;
import com.zito.manager.ArticleManager;
import com.zito.manager.ContributeManager;
import com.zito.manager.InvestManager;
import com.zito.manager.WeblinkManager;

/**
 * @author YunHai-Home
 * 
 */
public class Invest {

	public void index(HttpServletRequest request, HttpServletResponse response) {
		FreeMarkerEngine fm = new FreeMarkerEngine(request, response);
		fm.put("investMgr", new InvestManager());
		fm.put("articleMgr", new ArticleManager());
		fm.put("linkMgr", new WeblinkManager());
		fm.put("contributemgr", new ContributeManager());
		FreeMarkerEngine.action(fm, "www/Invest.html");
	}
	
	public void SubmitInvest(HttpServletRequest request, HttpServletResponse response) {
		FreeMarkerEngine fm = new FreeMarkerEngine(request, response);
		InvestManager obj = new InvestManager();
		boolean re = false;
		String message = "提交成功!";
		try {
			re = obj.submitInvest();
		} catch (Exception e) {
			message = e.getMessage();
		}
		fm.put("success", re);
		fm.put("message", message);
		FreeMarkerEngine.action(fm, "submit.html");
	}
}
